package pkg

import (
	"fmt"
	"seckill/global/model"

	"github.com/redis/go-redis/v9"
)

func RedisConn() {
	model.RDB = redis.NewClient(&redis.Options{
		Addr:     "14.103.158.217:6379",
		Password: "redis_x3jTtC",
		DB:       0,
	})
	if err := model.RDB.Ping(model.Ctx).Err(); err != nil {
		panic(err)
	}
	fmt.Println("redis connect success")
}
